﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace TrackingSim.GraphicSystem.Models
{
    public class ObjectModel : ResourceSystem.Resource
    {
        List<ObjectMesh> m_object_meshes;
        Matrix m_model_to_world;

        public ObjectModel()
        {
            m_object_meshes = new List<ObjectMesh>();
            m_model_to_world = Matrix.Identity;
        }

        public ObjectModel(string name, string path)
            : base(name, path)
        {
            m_object_meshes = new List<ObjectMesh>();
            m_model_to_world = Matrix.Identity;
        }

        public List<ObjectMesh> Meshes
        {
            get { return m_object_meshes; }
        }

        public Matrix ModelToWorld
        {
            get { return m_model_to_world; }
            set { m_model_to_world = value; }
        }

        public void draw(GraphicsDevice device)
        {
            foreach (ObjectMesh mesh in m_object_meshes)
            {
                mesh.draw(device);
            }
        }
    }
}
